/*
 * @Description: tyll
 * @Autor: czp
 * @Date: 2019-10-12 18:03:21
 * @LastEditors: czp
 * @LastEditTime: 2020-11-26 15:08:50
 */
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'
import iView from 'view-design'
import i18n from '@/locale'
import config from '@/config'
import importDirective from '@/directive'
import {
    directive as clickOutside
} from 'v-click-outside-x'
import installPlugin from '@/plugin'
import './index.less'
import '@/assets/icons/iconfont.css'
import TreeTable from 'tree-table-vue'
import VOrgTree from 'v-org-tree'
import 'v-org-tree/dist/v-org-tree.css'

// 导入自定义插件
import MyPlugin from '@/myPlugin'

// 实际打包时应该不引入mock
/* eslint-disable */
if (process.env.NODE_ENV !== 'production') require('@/mock')

Vue.use(iView, {
    i18n: (key, value) => i18n.t(key, value)
})
Vue.use(TreeTable)
Vue.use(VOrgTree)
Vue.use(MyPlugin(['journal-edit', 'daily-data-edit', 'msg-detail', 'scan-detail', 'floor-page', 'area-page', 'module-page', 'workstation-team', 'branch-info', 'floor-info', 'extend-page', 'daily-page', 'active-page', 'journal-page-detail', 'journal-page-all', 'info-all', 'integral-page-detail', 'check-log', 'check-all', 'question-set', 'work-all', 'daily-data-detail', 'daily-data-all', 'targets-page', 'remark-page', 'integral-page-bonus', 'mistake-check', 'mistake-matter']))

/**
 * @description 注册admin内置插件
 */
installPlugin(Vue)

/**
 * @description 生产环境关掉提示
 */
Vue.config.productionTip = false

/**
 * @description 全局注册应用配置
 */
Vue.prototype.$config = config

/**
 * 注册指令
 */
importDirective(Vue)
Vue.directive('clickOutside', clickOutside)

/* eslint-disable no-new */
new Vue({
    el: '#app',
    router,
    i18n,
    store,
    render: h => h(App)
})